<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Team extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('team', function (Blueprint $table) {
            $table->increments('id');
            $table->string('openid')->nullable()->comment('openid');
            $table->tinyInteger('nums')->default(0)->comment('团成员数');
            $table->integer('pro_id')->comment('产品id');
            $table->tinyInteger('status')->default(0)->nullable()->comment('组团状态,0再组 1已完成');

            $table->timestamps();
        });

        //队员表
        Schema::create('team_p', function (Blueprint $table) {
            $table->increments('id');
            $table->string('tm_openid',30)->nullable()->comment('团员openid');
            $table->integer('tm_id')->nullable()->commnet('所属团id');
        });

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('team');
        Schema::dropIfExists('team_p');
    }
}
